<%--
  -	Date: 2012-03-27
  -
  - Copyright (C) 2012 Jawa Software. All rights reserved.
  - 安装过程
--%>

<%@ page pageEncoding="utf-8"%>
<%@page import="java.util.Iterator"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page"%>

<%!
	public String generateCss(int step,int currentStep){
	    String css = "";
	    if(step == currentStep){
	    	css = "icon-chevron-right";
	    }else if(step <= currentStep){
	    	css = "icon-ok-sign";
	    }else{
	    	css = "icon-info-sign";
	    }
	    return css;
	}
%>

<decorator:usePage id="decoratedPage" />

<jsp:useBean id="webManager" class="org.jawa.util.WebManager" />
<%
	webManager.init(request, response, session, application, out);
%>

<%
	String path = request.getContextPath();

	int currentStep = decoratedPage.getIntProperty("meta.currentStep");
	
	double a = (currentStep*1.0 /5.0)*100;
	
%>

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>服务器安装</title>
    	<link rel="stylesheet"  href="<%= path %>/styles/bootstrap.css">
    	<link rel="stylesheet"  href="<%= path %>/styles/global.css">
		<style type="text/css">
			body {
				padding-top: 60px;
				padding-bottom: 20px;
			}
			
			.sidebar-nav {
				padding: 9px 0;
			}
			</style>
		<decorator:head />
		<script src="<%=path%>/scripts/jquery.js"></script>
	</head>

	<body>
		<div class="navbar navbar-fixed-top">
			<div class="navbar-inner">
				<div class="container-fluid">
					    <a class="brand span4" href="#">服务器安装</a>
						<div class="span8 progress "
							style="border: 1px solid #DDDDDD; padding: 1px;margin-top: 10px;">
							<div class="bar" style="width: <%=a %>%">
							</div>
						</div>
						<div class="span4  ">
						</div>
				</div>
			</div>
		</div>

		<div class="container-fluid">
			<div class="row-fluid">
				<div class="span2">
					<div class="well sidebar-nav">
						<ul class="nav nav-list">
							
							<li class="<%=1 == currentStep ? "active" : ""%>">
								<a href="<%=currentStep>=1?"index.jsp":"#"%>"><i class="<%=generateCss(1,currentStep)%>"></i> 检查环境</a>
							</li>
							<li class="<%=2 == currentStep ? "active" : ""%>">
								<a href="<%=currentStep>=2?"setup-datasource-settings.jsp":"#"%>"><i class="<%=generateCss(2,currentStep)%>"></i> 数据库设置</a>
							</li>
							<li class="<%=3 == currentStep ? "active" : ""%>">
								<a href="<%=currentStep>=3?"setup-clustering-settings.jsp":"#"%>"><i class="<%=generateCss(3,currentStep)%>"></i> 缓存设置</a>
							</li>
							<li class="<%=4 == currentStep ? "active" : ""%>">
								<a href="<%=currentStep>=4?"setup-mail-settings.jsp":"#"%>"><i class="<%=generateCss(4,currentStep)%>"></i> 邮件设置</a>
							</li>
							<li class="<%=5 == currentStep ? "active" : ""%>">
								<a href="<%=currentStep>=5?"setup-admin-settings.jsp":"#"%>"><i class="<%=generateCss(5,currentStep)%>"></i> 管理员账户</a>
							</li>
						</ul>
					</div>
				</div>

				<div class="span10">
					<decorator:body />
				</div>

			</div>

			<hr>

			<footer>
			<p>
				&copy; Company 2012
			</p>
			</footer>

		</div>

	</body>
</html>
